﻿using Microsoft.AspNetCore.Mvc;
using VerEasy.Core.Extensions.Caching.Redis;

namespace VerEasy.Core.Api.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class DashboardController(IRedisCache redis) : ControllerBase
    {
        private readonly IRedisCache redis = redis;

        [HttpGet]
        public List<string> RedisCache()
        {
            redis.Set("1", "1");
            redis.Set("2", "2");
            redis.Set("3", "3");
            List<string> list = new List<string>();
            list.Add(redis.Get("1"));
            list.Add(redis.Get("2"));
            list.Add(redis.Get("3"));

            redis.Clear();
            return list;
        }
    }
}